package cn.iocoder.yudao.module.mqtt.controller.admin.config.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - MQTT配置 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ConfigRespVO {

    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21787")
    @ExcelProperty("主键ID")
    private Long id;

    @Schema(description = "MQTT配置名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("MQTT配置名称")
    private String name;

    @Schema(description = "用户名", example = "王五")
    @ExcelProperty("用户名")
    private String username;

    @Schema(description = "密码")
    @ExcelProperty("密码")
    private String password;

    @Schema(description = "MQTT服务器地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
    @ExcelProperty("MQTT服务器地址")
    private String url;

    @Schema(description = "订阅客户端ID", example = "2315")
    @ExcelProperty("订阅客户端ID")
    private String subClientId;

    @Schema(description = "订阅主题，多个主题用逗号分隔")
    @ExcelProperty("订阅主题，多个主题用逗号分隔")
    private String subTopics;

    @Schema(description = "发布客户端ID", example = "18921")
    @ExcelProperty("发布客户端ID")
    private String pubClientId;

    @Schema(description = "0 离线 1 在线", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("0 离线 1 在线")
    private String isOnline;

    @Schema(description = "是否启用：0-禁用，1-启用", example = "mqtt")
    @ExcelProperty(value = "是否启用：0-禁用，1-启用", converter = DictConvert.class)
    @DictFormat("mqtt_config_enabled") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean enabled;

    @Schema(description = "描述", example = "你猜")
    @ExcelProperty("描述")
    private String description;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}